#include "information1.h"
#include "Simulated_universe.h"
#include "main.h"
#include "music.h"
#include <Windows.h>
#include <conio.h>
#include <ctime>
#include <fstream>
#include <iostream>
#include <mmsystem.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include <vector>
#include <windows.h>
using namespace std;
// int achievement1[100],easter_egg[100],opt[100];
extern int achievement1[100], form_yx, form_yy, easter_egg[100], opt[100];

// void information2(int x,int y,int easter_egg[],int opt[1]);
// void achievements(int achievement1[],int opt1);

void information2(int x, int y, int easter_egg[], int opt1) {
    x -= 100;
    y -= 100;
    if (opt1 == 2) {
        if (x == 5 && y == 34 && easter_egg[1] == 0) {
            printf("\nHello! This is an unremarkable trash can.\n");
            getch();
            printf("You stared at her for a long time, but she was still an "
                   "ordinary trash can.\n");
            getch();
            printf("You restrained the impulse to open her.\n");
            getch();
            system("cls");
            easter_egg[1]++;
        } else if (x == 5 && y == 34 && easter_egg[1] == 1) {
            printf("\nYou stared at the trash cans for a long time, and they "
                   "seemed to have changed.\n The edges of the metal cans were "
                   "no longer rusty, \nand the depressions on the cans were "
                   "much smoother.\n");
            getch();
            printf("A faint golden light emanated from under the lid of the "
                   "barrel - sweet and enticing.\n");
            getch();
            printf("For a moment, you even feel like the trash can has turned "
                   "into a treasure chest.\n");
            getch();
            printf("... This moment has finally arrived.\n");
            getch();
            printf("You take a deep breath, reach out your hand, and lift the "
                   "lid of the bucket: \n      there's nothing inside.\n");
            getch();
            printf("No, you bent down and reached into the trash can, "
                   "\npicking up a piece of iron from the bottom.\n Hard work "
                   "pays off, you finally found the treasure!\n");
            getch();
            printf("You turned around and saw your companions looking at you "
                   "with complex expressions.\n");
            getch();
            printf("\'......Don't explain, I understand. This impulse is too "
                   "strong for you.\'\n");
            getch();
            printf("\'......Once a person steps on this path, they cannot turn "
                   "back.\'\n");
            getch();
            printf("OBTAIN ACHIEVEMENT: THE RUBBISH KING!\n");
            getch();
            system("cls");
            easter_egg[1]++;
        } else if (x == 5 && y == 34 && easter_egg[1] == 2) {
            printf("\nThis is an unremarkable trash can.\n");
            getch();
            system("cls");
            // system("pause");
        }
    } else if (opt1 == 1) {
        if (x == 7 && y == 60) {
            printf("\n你要进入模拟宇宙吗？\n:[");
            char tc = getchar();
            form_yx = you.x;
            form_yy = you.y;
            if (tc == 'y')
                Interface();
            system("cls");
            you.x = form_yx;
            you.y = form_yy;
        }
        if (x == 5 && y == 34 && easter_egg[1] == 0) {
            printf("\n这是一个平平无奇的垃圾桶\n");
            getch();
            printf("你盯着垃圾桶看了许久，但这还是平平无奇的垃圾桶，\n");
            getch();
            printf("你克制住打开她的冲动\n");
            getch();
            system("cls");
            easter_egg[1]++;
        } else if (x == 5 && y == 34 && easter_egg[1] == 1) {
            printf("\n你盯着垃圾桶看了许久,它们好像变了,"
                   "桶身上的凹陷也平整了许多,寒铁桶边不再锈迹斑斑，\n");
            getch();
            printf("从桶盖下微微透出金色的光芒--甜蜜而诱人.\n");
            getch();
            printf("有一瞬间，你甚至觉得垃圾桶变成了宝箱。\n");
            getch();
            printf("... 这一刻还是来了\n");
            getch();
            printf("你深吸一口气，伸出手，掀开桶盖:里面什么都没有\n");
            getch();
            printf("不对，你弯腰把手伸进垃圾桶里,"
                   "从桶底捡起一块铁片。\n功夫不负有心人,你终于找到了宝藏!\n");
            getch();
            printf("你回过头，只见同伴们神情复杂地看着你。\n");
            getch();
            printf("\'......不要解释，我明白，对你来说这种冲动太强烈啦。\'\n");
            getch();
            printf("\'......人一旦踏上这条路，就回不了头了。\'\n");
            getch();
            printf("获得成就: 垃圾桶之王\n");
            achievement1[1] = 1;
            getch();
            system("cls");
            easter_egg[1]++;
        } else if (x == 5 && y == 34 && easter_egg[1] == 2) {
            printf("\n这只是一个平平无奇的垃圾桶\n");
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        } else if (x == 5 && y == 34 && easter_egg[1] == 3) {
            printf("\n这只是一个平平无奇的垃圾桶,"
                   "但她已经在你心中留下了第一次的欣喜。\n");
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        } else if (x == 5 && y == 34 && easter_egg[1] == 4) {
            printf("\n这只是一个平平无奇的垃圾桶\n");
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        } else if (x == 5 && y == 34 && easter_egg[1] == 5) {
            printf("\n真的没有彩蛋了\n");
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        } else if (x == 5 && y == 34 && easter_egg[1] == 6) {
            printf("\n这只是一个平平无奇的垃圾桶\n");
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        } else if (x == 5 && y == 34 && easter_egg[1] == 7) {
            printf("\n你怎么还点\n");
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        } else if (x == 5 && y == 34 && easter_egg[1] == 8) {
            printf("\n唉,还是被你发现了\n");
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        } else if (x == 5 && y == 34 && easter_egg[1] == 9) {
            printf("\n其实......呼~~哈~~<3\n");
            getch();
            printf("\n(你终于控制不住自己，开始对着她上下其手\n");
            getch();
            printf("(这个垃圾桶仿佛受了什么刺激，开始轻轻的喘着\n");
            getch();
            printf("..................\n");
            getch();
            HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
            // if (hOut == INVALID_HANDLE_VALUE) return GetLastError();
            DWORD dwMode = 0;
            // if (!GetConsoleMode(hOut, &dwMode)) return GetLastError();
            dwMode |= 0x0004;
            // if (!SetConsoleMode(hOut, dwMode)) return GetLastError();
            wprintf(L"\x1b[38;2;%d;%d;%dmHelloworld", 255, 255, 0);
            printf("\n获得成就: 审核饶命\n");
            achievement1[2] = 1;
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        } else if (x == 5 && y == 34 && easter_egg[1] >= 8) {
            printf("\n这曾经是一个平平无奇的垃圾桶\n");
            getch();
            system("cls");
            easter_egg[1]++;
            // system("pause");
        }
        if (x == 5 && y == 25) {
            printf("这是一架钢琴");
            printf("\n要试试吗？");
            printf("\n不你没有选择的权力 \n直接来吧(exit 退出):[");
            play_piano();
        }
    }
};
void achievements() {
    system("cls");
    if (opt[1] == 1) {
        printf("成就：\n");
        if (achievement1[1] == 1) {
            printf("垃圾桶之王: 完成(?)与垃圾桶的邂逅\n");
        }
        if (achievement1[2] == 1) {
            printf("审核饶命: 完成与垃圾桶的深入交流\n");
        }
        if (achievement1[3] == 1) {
            printf("大梦叠音,似曾相识: 用钢琴弹奏出大梦的曲调\n");
        }
        if (achievement1[4] == 1) {
            printf("抽出作者wxhz(千分之一): 在抽卡中抽出作者\n");
        }
        if (achievement1[5] == 1) {
            printf("抽出作者Chesten(万分之一): 在抽卡中抽出作者\n");
        }
    }
    system("pause");
    return;
}